home *** CD-ROM | disk | FTP | other *** search
/ You're the Director / You're The Director.iso / pc / pcf / ds.dir / 00001.ls next >
Encoding:
Text File  |  1995-10-08  |  14.5 KB  |  609 lines

  1. on startMovie
  2.   global max, movielist, limit, splist, reset, letgo, exitFrame, gSound, prev, gCurrentSprite, Double, Increment
  3.   set Increment to 1
  4.   set Double to 0
  5.   set gCurrentSprite to 3
  6.   set prev to 0
  7.   set gSound to 6
  8.   set prev to 0
  9.   set letgo to 0
  10.   set reset to 0
  11.   set the visible of sprite 19 to 0
  12.   updateStage()
  13.   set magcursor to [the number of cast "Clapboard"]
  14.   set the cursor of sprite 1 to magcursor
  15.   set the textSize of field "movie" to 24
  16.   set the textSize of field "name" to 24
  17.   repeat with i = 21 to 45
  18.     puppetSprite(i, 1)
  19.   end repeat
  20.   set the visible of sprite 45 to 0
  21.   initsel()
  22.   set splist to [[195, 211], [195, 294], [195, 377], [443, 211], [443, 294], [443, 377]]
  23.   set limit to 24
  24.   set movielist to []
  25.   hidebar()
  26.   set max to count(movielist)
  27.   when keyDown then globalkey
  28.   puppetSprite(48, 1)
  29.   set the visible of sprite 48 to 0
  30.   updateStage()
  31.   go("Options")
  32.   updateStage()
  33. end
  34.  
  35. on testbut
  36.   global movielist
  37.   if count(movielist) <= 0 then
  38.     repeat with i = 12 to 18
  39.       set the visible of sprite i to 0
  40.     end repeat
  41.   else
  42.     repeat with i = 12 to 18
  43.       set the visible of sprite i to 1
  44.     end repeat
  45.   end if
  46. end
  47.  
  48. on setdef
  49.   repeat with i = 12 to 18
  50.     set the visible of sprite i to 1
  51.   end repeat
  52. end
  53.  
  54. on addbar x
  55.   global letgo, movielist
  56.   put "inside addbar"
  57.   if count(movielist) >= 24 then
  58.     exit
  59.   end if
  60.   set letgo to 0
  61.   set yu to string(item 1 of the name of cast the castNum of sprite x)
  62.   add(movielist, yu)
  63.   set max to count(movielist)
  64.   reset()
  65.   setbar()
  66. end
  67.  
  68. on addbarC x
  69.   global letgo, movielist
  70.   if count(movielist) >= 24 then
  71.     exit
  72.   end if
  73.   set letgo to 0
  74.   set vu to the number of cast string(chars(the name of cast the castNum of sprite x, 1, 2) & "s")
  75.   set yu to string(item 1 of the name of cast vu)
  76.   add(movielist, yu)
  77.   set max to count(movielist)
  78.   set the castNum of sprite (20 + max) to vu
  79.   updateStage()
  80.   showbar()
  81.   reset()
  82. end
  83.  
  84. on showbar
  85.   global movielist, max, limit
  86.   set the visible of sprite 2 to 1
  87.   repeat with i = 21 to 20 + count(movielist)
  88.     set the visible of sprite i to 1
  89.   end repeat
  90.   repeat with i = 20 + count(movielist) + 1 to 20 + limit
  91.     set the visible of sprite i to 0
  92.   end repeat
  93.   updateStage()
  94. end
  95.  
  96. on showbarB
  97.   global movielist, max, limit
  98.   set the visible of sprite 2 to 1
  99.   repeat with i = 21 to 20 + count(movielist)
  100.     set the visible of sprite i to 1
  101.   end repeat
  102.   repeat with i = 20 + count(movielist) + 1 to 20 + limit
  103.     set the visible of sprite i to 0
  104.   end repeat
  105. end
  106.  
  107. on hidebar
  108.   global movielist, max, limit
  109.   if the frame > 18 then
  110.     set the visible of sprite 2 to 0
  111.   end if
  112.   repeat with i = 21 to 20 + limit
  113.     set the visible of sprite i to 0
  114.   end repeat
  115.   updateStage()
  116. end
  117.  
  118. on setbar
  119.   global movielist, max, selected, limit, Double
  120.   put "inside setbar"
  121.   if count(movielist) = 0 then
  122.     repeat with i = 21 to 20 + limit
  123.       set the visible of sprite i to 0
  124.     end repeat
  125.     exit
  126.   end if
  127.   repeat with i = 1 to count(movielist)
  128.     set the castNum of sprite (20 + i) to the number of cast string(getAt(movielist, i))
  129.   end repeat
  130.   repeat with i = 1 to count(selected)
  131.     if getAt(selected, i) = 1 then
  132.       if Double = 0 then
  133.         set the ink of sprite (20 + i) to 4
  134.         put "above puppetSprite 45 is true"
  135.         puppetSprite(45, 1)
  136.         set the moveableSprite of sprite 45 to 1
  137.         set newsprite to 20 + i
  138.         set the locH of sprite 45 to the locH of sprite newsprite
  139.         set the locV of sprite 45 to the locV of sprite newsprite
  140.         set the visible of sprite 45 to 1
  141.         set the moveableSprite of sprite 45 to 0
  142.         updateStage()
  143.       end if
  144.       next repeat
  145.     end if
  146.     set the ink of sprite (20 + i) to 0
  147.   end repeat
  148.   if Double = 0 then
  149.     showbar()
  150.   end if
  151. end
  152.  
  153. on setbarB
  154.   global movielist, max, selected, limit, Double
  155.   put "inside setbar"
  156.   if count(movielist) = 0 then
  157.     repeat with i = 21 to 20 + limit
  158.       set the visible of sprite i to 0
  159.     end repeat
  160.     exit
  161.   end if
  162.   repeat with i = 1 to count(movielist)
  163.     set the castNum of sprite (20 + i) to the number of cast string(getAt(movielist, i))
  164.   end repeat
  165.   repeat with i = 1 to count(selected)
  166.     if getAt(selected, i) = 1 then
  167.       if Double = 0 then
  168.         set the ink of sprite (20 + i) to 4
  169.         put "above puppetSprite 45 is true"
  170.         puppetSprite(45, 1)
  171.         set the moveableSprite of sprite 45 to 1
  172.         set newsprite to 20 + i
  173.         set the locH of sprite 45 to the locH of sprite newsprite
  174.         set the locV of sprite 45 to the locV of sprite newsprite
  175.         set the visible of sprite 45 to 1
  176.         set the moveableSprite of sprite 45 to 0
  177.       end if
  178.       next repeat
  179.     end if
  180.     set the ink of sprite (20 + i) to 0
  181.   end repeat
  182.   if Double = 0 then
  183.     showbarB()
  184.   end if
  185. end
  186.  
  187. on namesmall
  188.   set x1 to 100
  189.   repeat with i = 1 to 36
  190.     set yur to numToChar(charToNum("`") + (i / 6) + 1)
  191.     set the name of cast (i + x1) to string(yur & i mod 6) & "s"
  192.     if (i mod 6) = 0 then
  193.       set the name of cast (i + x1) to string(numToChar(charToNum(yur) - 1) & "6") & "s"
  194.     end if
  195.   end repeat
  196. end
  197.  
  198. on namemov
  199.   set x1 to 136
  200.   repeat with i = 1 to 36
  201.     set yur to numToChar(charToNum("`") + (i / 6) + 1)
  202.     set the name of cast (i + x1) to string(yur & i mod 6) & ".mov"
  203.     if (i mod 6) = 0 then
  204.       set the name of cast (i + x1) to string(numToChar(charToNum(yur) - 1) & "6") & ".mov"
  205.     end if
  206.   end repeat
  207. end
  208.  
  209. on initsp
  210.   global splist
  211.   set splist to []
  212.   set x to 3
  213.   repeat with i = x to x + 5
  214.     add(splist, [the locH of sprite i, the locV of sprite i])
  215.   end repeat
  216. end
  217.  
  218. on reset
  219.   global splist, reset
  220.   if the frame = 56 then
  221.     exit
  222.   end if
  223.   set x to 13
  224.   repeat with i = x to x + 5
  225.     set yu to getAt(splist, i - x + 1)
  226.     set the locH of sprite i to getAt(yu, 1)
  227.     set the locV of sprite i to getAt(yu, 2)
  228.     set the castNum of sprite i to the number of cast string(chars(the name of cast the castNum of sprite i, 1, 2))
  229.     set the ink of sprite i to 0
  230.     updateStage()
  231.   end repeat
  232.   updateStage()
  233. end
  234.  
  235. on playmovn
  236.   set yu to the clickOn
  237.   puppetSprite(48, 1)
  238.   set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  239.   set the visible of sprite 48 to 1
  240.   set the movieTime of sprite 48 to 0
  241.   set the movieRate of sprite 48 to 1
  242.   repeat while (the movieTime of sprite 48 < the duration of cast the castNum of sprite 48) and the controlDown
  243.     updateStage()
  244.   end repeat
  245.   set the movieTime of sprite 48 to 0
  246.   set the movieRate of sprite 48 to 0
  247.   set the visible of sprite 48 to 0
  248. end
  249.  
  250. on playmovn2
  251.   set yu to the clickOn
  252.   puppetSprite(48, 1)
  253.   set yu to 0
  254.   repeat with i = 1 to count(movielist)
  255.     if getAt(selected, i) = 1 then
  256.       set yu to i
  257.     end if
  258.     if yu <> 0 then
  259.       exit repeat
  260.     end if
  261.   end repeat
  262.   if yu = 0 then
  263.     exit
  264.   end if
  265.   set yu to yu + 20
  266.   set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  267.   set the visible of sprite 48 to 1
  268.   updateStage()
  269.   set the movieTime of sprite 48 to 0
  270.   set the movieRate of sprite 48 to 1
  271.   updateStage()
  272.   repeat while (the movieTime of sprite 48 < the duration of cast the castNum of sprite 48) and not (the controlDown)
  273.     updateStage()
  274.   end repeat
  275.   set the movieTime of sprite 48 to 0
  276.   set the movieRate of sprite 48 to 0
  277.   set the visible of sprite 48 to 0
  278.   updateStage()
  279.   repeat with x = 13 to 18
  280.     set the visible of sprite x to 1
  281.   end repeat
  282.   updateStage()
  283. end
  284.  
  285. on playmovn3
  286.   global prev
  287.   if prev = 1 then
  288.     set yu to the clickOn
  289.     puppetSprite(48, 1)
  290.     set yu to 0
  291.     repeat with i = 1 to count(movielist)
  292.       if getAt(selected, i) = 1 then
  293.         set yu to i
  294.         set the visible of sprite 19 to 1
  295.         puppetSound(0)
  296.         updateStage()
  297.       end if
  298.       if yu <> 0 then
  299.         exit repeat
  300.       end if
  301.     end repeat
  302.     if yu = 0 then
  303.       set prev to 0
  304.       exit
  305.     end if
  306.     set yu to yu + 20
  307.     set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  308.     set the visible of sprite 48 to 1
  309.     updateStage()
  310.     set the movieTime of sprite 48 to 0
  311.     set the movieRate of sprite 48 to 1
  312.     updateStage()
  313.     set prev to 2
  314.   end if
  315.   if (the movieTime of sprite 48 < the duration of cast the castNum of sprite 48) and not (the controlDown) then
  316.     updateStage()
  317.   else
  318.     set prev to 0
  319.     set the movieTime of sprite 48 to 0
  320.     set the movieRate of sprite 48 to 0
  321.     set the visible of sprite 48 to 0
  322.     updateStage()
  323.     set the visible of sprite 19 to 0
  324.     repeat with x = 13 to 18
  325.       set the visible of sprite x to 1
  326.     end repeat
  327.     repeat with x = 3 to 8
  328.       puppetSprite(x, 1)
  329.       set the visible of sprite x to 1
  330.       puppetSprite(x, 0)
  331.     end repeat
  332.     puppetSprite(20, 1)
  333.     set the visible of sprite 20 to 1
  334.     puppetSprite(20, 0)
  335.     puppetSound("OPEN.AIF")
  336.     play done
  337.     updateStage()
  338.   end if
  339. end
  340.  
  341. on playmovn4 yu
  342.   global k, mm
  343.   set yu to yu + 20
  344.   set i to chars(the name of cast the castNum of sprite yu, 1, 3)
  345.   set place to getOne(movielist, i)
  346.   set k to place
  347.   set mm to place
  348.   set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  349.   set the visible of sprite 48 to 1
  350.   updateStage()
  351.   set the movieTime of sprite 48 to 0
  352.   set the movieRate of sprite 48 to 1
  353.   updateStage()
  354. end
  355.  
  356. on initsel
  357.   global selected
  358.   set selected to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  359. end
  360.  
  361. on delset
  362.   global selected, movielist
  363.   if count(movielist) <= 0 then
  364.     exit
  365.   end if
  366.   set sel to countsel()
  367.   if sel = 0 then
  368.     exit
  369.   end if
  370.   set del to []
  371.   repeat with i = 1 to count(movielist)
  372.     if getAt(selected, i) = 1 then
  373.       setAt(movielist, i, 0)
  374.     end if
  375.   end repeat
  376.   put del
  377.   set mv2 to []
  378.   repeat with i in movielist
  379.     if i <> 0 then
  380.       add(mv2, i)
  381.     end if
  382.   end repeat
  383.   set movielist to mv2
  384.   set the visible of sprite 45 to 0
  385.   updateStage()
  386.   initsel()
  387.   setbar()
  388. end
  389.  
  390. on plusset
  391.   global selected, movielist
  392.   if count(movielist) <= 0 then
  393.     exit
  394.   end if
  395.   set sel to countsel()
  396.   if (sel = count(movielist)) or (sel = 0) then
  397.     exit
  398.   end if
  399.   initsel()
  400.   setAt(selected, sel, 1)
  401.   repeat with i = count(movielist) - 1 down to 1
  402.     if getAt(selected, i) = 1 then
  403.       set yut to getAt(movielist, i)
  404.       setAt(movielist, i, getAt(movielist, i + 1))
  405.       setAt(movielist, i + 1, yut)
  406.       deleteAt(selected, count(selected))
  407.       addAt(selected, 1, 0)
  408.       exit repeat
  409.     end if
  410.   end repeat
  411.   put "inside plusset"
  412.   setbar()
  413. end
  414.  
  415. on minset
  416.   global selected, movielist
  417.   if count(movielist) <= 0 then
  418.     exit
  419.   end if
  420.   if getAt(selected, 1) = 1 then
  421.     exit
  422.   end if
  423.   set sel to countsel()
  424.   if sel = 0 then
  425.     exit
  426.   end if
  427.   initsel()
  428.   setAt(selected, sel, 1)
  429.   repeat with i = 1 to count(movielist)
  430.     if getAt(selected, i) = 1 then
  431.       set yut to getAt(movielist, i)
  432.       deleteAt(movielist, i)
  433.       add(movielist, i - 1, yut)
  434.       deleteAt(selected, 1)
  435.       add(selected, 0)
  436.       exit repeat
  437.     end if
  438.   end repeat
  439.   put "inside minset"
  440.   setbar()
  441. end
  442.  
  443. on countsel
  444.   repeat with i = 1 to count(selected)
  445.     if getAt(selected, i) = 1 then
  446.       return i
  447.       exit
  448.     end if
  449.   end repeat
  450.   return 0
  451. end
  452.  
  453. on clearall
  454.   global movielist
  455.   set movielist to []
  456.   set the visible of sprite 45 to 0
  457.   initsel()
  458.   put "inside clearall"
  459.   setbar()
  460. end
  461.  
  462. on globalkey
  463.   if the key = BACKSPACE then
  464.     delset()
  465.   end if
  466.   if the key = "+" then
  467.     plusset()
  468.   end if
  469.   if the key = "-" then
  470.     minset()
  471.   end if
  472. end
  473.  
  474. on compilemov
  475.   global movielist, comp, k, mm, Double
  476.   if k = 0 then
  477.     puppetSprite(48, 1)
  478.     set k to 0
  479.     set mm to 1
  480.   end if
  481.   if k <> mm then
  482.     set k to mm
  483.     if k <= count(movielist) then
  484.       set i to getAt(movielist, k)
  485.       initsel()
  486.       setAt(selected, k, 1)
  487.       if Double = 0 then
  488.         setbar()
  489.       end if
  490.       put "just after set bar"
  491.       set j to chars(i, 1, 2)
  492.       set Dump to the castNum of sprite 48
  493.       set the castNum of sprite 48 to the number of cast (j & ".mov")
  494.       unLoadCast(Dump)
  495.       set the directToStage of cast the castNum of sprite 48 to 1
  496.       set the visible of sprite 48 to 1
  497.       updateStage()
  498.       set the movieTime of sprite 48 to 0
  499.       set the movieRate of sprite 48 to 1
  500.       updateStage()
  501.     else
  502.       set the visible of sprite 48 to 0
  503.       puppetSprite(48, 0)
  504.       set comp to 0
  505.       set k to 0
  506.       puppetSprite(1, 0)
  507.       set Double to 0
  508.       setbarB()
  509.       go("EndMovie")
  510.     end if
  511.   end if
  512.   if the movieTime of sprite 48 < the duration of cast the castNum of sprite 48 then
  513.     updateStage()
  514.   else
  515.     set the movieRate of sprite 48 to 0
  516.     set mm to mm + 1
  517.   end if
  518. end
  519.  
  520. on quitmov
  521.   global comp, k, m
  522.   set the visible of sprite 48 to 0
  523.   puppetSprite(48, 0)
  524.   set comp to 0
  525.   set k to 0
  526. end
  527.  
  528. on RunOff
  529.   global gCurrentSprite
  530.   set the editableText of sprite gCurrentSprite to 0
  531.   if gCurrentSprite = 3 then
  532.     set gCurrentSprite to 4
  533.     updateStage()
  534.   else
  535.     set gCurrentSprite to 3
  536.     testbut()
  537.     setdef()
  538.     go("no")
  539.     showbar()
  540.   end if
  541. end
  542.  
  543. on beginMyMovie
  544.   global myWindow
  545.   if objectp(myWindow) then
  546.     forget(myWindow)
  547.   end if
  548.   set horzOrigin to the stageLeft
  549.   set vertOrigin to the stageTop
  550.   set myWindowRect to rect(horzOrigin, vertOrigin, horzOrigin + 640, vertOrigin + 480)
  551.   set myWindow to window "HelpMovie"
  552.   set the rect of myWindow to myWindowRect
  553.   set the fileName of myWindow to "HLP.DIR"
  554.   set the titleVisible of myWindow to 0
  555.   open(myWindow)
  556.   tell window "HelpMovie"
  557.     go("Sstart")
  558.   end tell
  559. end
  560.  
  561. on finishMovie
  562.   global myWindow
  563.   if objectp(myWindow) then
  564.     forget(myWindow)
  565.   end if
  566. end
  567.  
  568. on MovieOver
  569.   global myWindow
  570.   if objectp(myWindow) then
  571.     forget(myWindow)
  572.   end if
  573. end
  574.  
  575. on DoubleScreen
  576.   global Double
  577.   if Double = 0 then
  578.     if the visible of sprite 48 = 1 then
  579.       set MovHt to 480
  580.       set MovWd to 640
  581.       set the height of sprite 48 to MovHt
  582.       set the width of sprite 48 to MovWd
  583.       set Back to the locV of sprite 1
  584.       set Back to Back + 1
  585.       puppetSprite(1, 1)
  586.       set the moveableSprite of sprite 1 to 1
  587.       set the locV of sprite 1 to Back
  588.       set the moveableSprite of sprite 1 to 0
  589.       puppetSprite(1, 0)
  590.       updateStage()
  591.       set Double to 1
  592.     end if
  593.   end if
  594. end
  595.  
  596. on HalfScreen
  597.   global Double
  598.   put "inside double mouseup"
  599.   if Double = 1 then
  600.     set Back to the locV of sprite 1
  601.     set Back to Back - 1
  602.     set the locV of sprite 1 to Back
  603.     set the height of sprite 48 to 240
  604.     set the width of sprite 48 to 320
  605.     updateStage()
  606.     set Double to 0
  607.   end if
  608. end
  609.